package org.xiaoyu.rpc;

import org.xiaoyu.rpc.remoting.transport.server.RpcNettyServer;

/**
 * Created By Have
 * 2021/7/12 22:01
 */
public class RpcProtocolServer implements ProtocolServer {
    private RpcNettyServer server;
    private String address;

    public RpcProtocolServer(RpcNettyServer server) {
        this.server = server;
        server.start();
    }

    @Override
    public String getAddress() {
        return address;
    }

    @Override
    public void setAddress() {
        this.address = address;
    }

    @Override
    public void close() {
        if (server != null) {
            server.shutdown();
        }
    }
}
